package easy._104_MaximumDepthOfBinaryTree;

public class MaximumDepthOfBinaryTree {
    public int maxDepth(TreeNode root) {
        if(root==null){
            return  0;
        }else{
            int leftDepth,rightDepth = 0;
            return 1+(((leftDepth = maxDepth(root.left))>(rightDepth = maxDepth(root.right)))?leftDepth:rightDepth);
        }
    }
}
